Add support for metadata in TerminalError#646
Open
PfisterFactor wants to merge 1 commit intorestatedev:mainfrom
Open
Add support for metadata in TerminalError#646PfisterFactor wants to merge 1 commit intorestatedev:mainfrom
PfisterFactor wants to merge 1 commit intorestatedev:mainfrom
Conversation
Add a `metadata` field (Record<string, string>) to the TerminalError
class, enabling propagation of key-value metadata through the Restate
protocol (requires service protocol v6+).
Changes:
- TerminalError constructor now accepts an optional `metadata` option
- metadata is converted to WasmFailureMetadata format ({key, value}[])
when sending to the VM via propose_run_completion_failure and
sys_write_output_failure
- metadata is deserialized back to Record<string, string> when
receiving Failure completions from the VM
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
From my understanding - the Restate runtime has supported attaching metadata to errors since this commit, but I don't see any of that functionality exposed in the Typescript SDK.
I worked with Claude Code to implement a patch for our own application that would allow attaching metadata to Terminal Errors, and thought I would try to upstream. In our own application this functionality is super useful since we add context to errors when we throw them and it gets lost when being converted to TerminalErrors through
ctx.runcalls.Since it is a small fix, I hope it isn't a pain to review - I don't want this to be an AI slop hit and run PR. Let me know if you want me to close this.